home *** CD-ROM | disk | FTP | other *** search
- Path: sn.no!not-for-mail
- From: ilan@sn.no (Ilan Sharoni)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Variable > string ?
- Date: 7 Feb 1996 07:09:45 +0100
- Organization: SN Internett
- Message-ID: <4f9fn9$q6c@sinsen.sn.no>
- References: <4evded$p1j@nntp.novia.net>
- NNTP-Posting-Host: sinsen.sn.no
- X-Newsreader: THOR 2.0 (SOUP)
-
- On 03-Feb-96 10:29:33, Tony Syslo (tsyslo@oasis.novia.net) Wrote:
- >I'm posting this for a friend:
- > Okay, here is another question I have..
- >
- > Message start:
- > Okay, I have also figured out the Timer usage, on how to figure the system
- > time, but now, I am wondering, how can I take a variable (say y=123456789)
- > and get the last two characters, ie, 89... Is it some sort of str___()
- > command? Also, how could I take the FIRST two characters, ie 12... ?? Thanx
- > for any and all help... Message End:
- >
- > Thanx again..
-
- If you only want to display it, use printf("%2s",y);
- Otherwise stci_d() converts an integer to a decimal string (SAS/C),
- stci_o converts integer to octal, stcl_d converts long to decimal etc.
- Try strmid() to extract a substring from a string.
-
- If you have SAS/C, you have all of it in the docs.
- If you have another compiler try sprintf()
-
-
- ilan
-